package lesson01;

import java.net.InetSocketAddress;

//端口

//netstat -ano #查看所有的端口
//netstat -ano|findstr "5900" #查看指定的端口
//tasklist|findstr "8696" #查看指定端口的进程
public class TestInetSocketAddress {
    public static void main(String[] args) {
        InetSocketAddress socketAddress = new InetSocketAddress("127.0.0.1", 8080);
        InetSocketAddress socketAddress2 = new InetSocketAddress("localhost", 8080);

        System.out.println(socketAddress);
        System.out.println(socketAddress2);

        System.out.println(socketAddress.getAddress());
        System.out.println(socketAddress.getHostName());    //地址
        System.out.println(socketAddress.getPort());        //端口

    }
}